<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="keywords" th:content="${config.keywords}">
    <meta name="description" th:content="${config.decText}">
    <link rel="shortcut icon" id="favicon" href="/static/favicon.ico"/>
    <title th:text="${config.siteName}"></title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/css/font-awesome.min.css" rel="stylesheet">
    <link href="/static/css/index2.css" rel="stylesheet">
    <script type="text/javascript" charset="utf-8" src="/static/js/jquery-1.11.3.min.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
</head>
<body id="home" style="">
<th:block th:include="~{include/header.html::header}"></th:block>
<section id="services" style="padding: 00px;">
    <div class="login_container">
        <div class="login_header">
            <h1 style="text-align: center;">
            用户登录
            </h1>
        </div>
        <div class="login_box">
            <div class="login_box_main">
                <form method="post" class="layui-form" id="dedwed" onsubmit="return false;">
                    <p class="input_box">
                        <input name="user" id="user1" placeholder="用户名/邮箱/手机号" type="text" lay-verify="required"
                               class="user_name input1" required>
                    </p>
                    <p class="input_box">
                        <input name="pwd" id="pwd1" lay-verify="required" placeholder="密码" type="password"
                               class="password input1" required>
                    </p>
                    <p class="login_btn">
                        <button value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit"
                                onclick="login();" ng-disabled='form.$invalid'>
                            登录
                        </button>
                    </p>
                </form>
                <p class="forget_box">
                    <a href="/register" ui-sref="access.signup" class="a1 ">
                        注册账号
                    </a>
                    <a class="a3" ui-sref="access.forgotpwd" href="/re_email">
                        忘记密码
                    </a>
                </p>
            </div>
        </div>
    </div>
</section>
<section id="contact-us" style="background: white;color: blue;padding: 10px;">
    <div class="container">
        <div class="section-header">
            <h2 class="section-title text-center wow fadeInDown">联系我们</h2>
            <p class="text-center wow fadeInDown"
               th:utext="'商户交流QQ群:'+${config.kfqqq}+' &nbsp; 网站客服QQ:'+${config.kfqq}"></p>
        </div>
    </div>
</section>
<footer id="footer" >
    <div class="container">
        <div class="row">
            <div class="col-sm-6">
                <th:block th:text="'Copyright ©2020 '+${config.copyright}+' All rights reserved.'"></th:block>
                <a href="http://www.miibeian.gov.cn/" target="_blank" th:text="${config.icpInfo}"></a>
            </div>
            <div class="col-sm-6"></div>
        </div>
    </div>
</footer>
</body>
<script src="/static/lib/layui/layui.js" charset="utf-8"></script>
<script src="/static/js/md5.js"></script>
<script src="/static/js/base64.js"></script>
<script>

    var base = new Base64();

    function kickout() {
        var href = location.href;
        if (href.indexOf("kickout") > 0) {
            alert("您的账号在另一台设备上登录,如非本人操作，请立即修改密码！");
            location.href = "/admin/login?t=" + new Date().getTime();
        }
    }

    window.onload = kickout();

    function login() {
        layer.msg("正在登录,请稍后...", {icon: 16, shade: 0.01, time: 15000});
        var user = $("#user1").val();
        var pwd = $("#pwd1").val();
        user = base.encode(user);
        pwd = base.encode($.md5(pwd));
        $.post("/login/ajax",
            {"user": user, "pwd": pwd},
            function (data) {
                layer.msg(data.msg);
                if (data.code == 0) {
                    setTimeout(function () {
                        location.href = "/admin?times=" + new Date().getTime();
                    }, 800);
                }
            }, "json");
    }
</script>
</html>